<!-- HTML header for doxygen 1.8.20-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=9"/>
	<meta name="generator" content="Doxygen 1.9.4"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
	<title>Raspberry Pi Pico SDK: include/pico/util/queue.h Source File</title>
	<!-- <link href="tabs.css" rel="stylesheet" type="text/css"/> -->
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="dynsections.js"></script>
	<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
	<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
	<link href="doxygen.css" rel="stylesheet" type="text/css" />
	<link href="normalise.css" rel="stylesheet" type="text/css"/>
<link href="main.css" rel="stylesheet" type="text/css"/>
<link href="styles.css" rel="stylesheet" type="text/css"/>
</head>
<body>
	<div class="navigation-mobile">
		<div class="logo--mobile">
			<a href="/"><img src="logo-mobile.svg" alt="Raspberry Pi"></a>
		</div>
		<div class="navigation-toggle">
			<span class="line-1"></span>
			<span class="line-2">
				<p>Menu Toggle</p>
			</span>
			<span class="line-3"></span>
		</div>
	</div>
	<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
		<div class="logo">
			<a href="index.html"> <img src="logo.svg" alt="Raspberry Pi"></a>
			<span style="display: inline-block; margin-top: 10px;">
				v2.1.0
			</span>
		</div>
		<div class="navigation-footer">
			<img src="logo-mobile.svg" alt="Raspberry Pi">
			<a href="https://www.raspberrypi.com/" target="_blank">By Raspberry Pi Ltd</a>
		</div>
<!-- 		<div class="search">
			<form>
				<input type="search" name="search" id="search" placeholder="Search">
				<input type="submit" value="Search">
			</form>
		</div> -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('queue_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle"><div class="title">queue.h</div></div>
</div><!--header-->
<div class="contents">
<a href="queue_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">/*</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment"> * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment"> *</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="comment"> * SPDX-License-Identifier: BSD-3-Clause</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="comment"> */</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="preprocessor">#ifndef _PICO_UTIL_QUEUE_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#define _PICO_UTIL_QUEUE_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#include &quot;<a class="code" href="pico_8h.html">pico.h</a>&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#include &quot;<a class="code" href="rp2__common_2hardware__sync_2include_2hardware_2sync_8h.html">hardware/sync.h</a>&quot;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span> </div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="comment">// PICO_CONFIG: PICO_QUEUE_MAX_LEVEL, Maintain a field for the highest level that has been reached by a queue, type=bool, default=0, advanced=true, group=queue</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="preprocessor">#ifndef PICO_QUEUE_MAX_LEVEL</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="preprocessor">#define PICO_QUEUE_MAX_LEVEL 0</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span> </div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span> </div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span><span class="preprocessor">#include &quot;<a class="code" href="lock__core_8h.html">pico/lock_core.h</a>&quot;</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span> </div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"><a class="line" href="structqueue__t.html">   32</a></span><span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span>    <a class="code hl_struct" href="structlock__core.html">lock_core_t</a> core;</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span>    uint8_t *data;</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span>    uint16_t wptr;</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span>    uint16_t rptr;</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span>    uint16_t element_size;</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span>    uint16_t element_count;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span><span class="preprocessor">#if PICO_QUEUE_MAX_LEVEL</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span>    uint16_t max_level;</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span>} <a class="code hl_struct" href="structqueue__t.html">queue_t</a>;</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span> </div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__queue.html#ga6b379b09df9ac326e3c07a2727b7ca96">queue_init_with_spinlock</a>(<a class="code hl_struct" href="structqueue__t.html">queue_t</a> *q, uint element_size, uint element_count, uint spinlock_num);</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span> </div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"><a class="line" href="group__queue.html#ga0aa8e36b5c51158d836e16c5be2b9925">   61</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__queue.html#ga0aa8e36b5c51158d836e16c5be2b9925">queue_init</a>(<a class="code hl_struct" href="structqueue__t.html">queue_t</a> *q, uint element_size, uint element_count) {</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span>    <a class="code hl_function" href="group__queue.html#ga6b379b09df9ac326e3c07a2727b7ca96">queue_init_with_spinlock</a>(q, element_size, element_count, <a class="code hl_function" href="group__hardware__sync.html#ga8f4578aa492d4d37dfbdab5c99ab5b1c">next_striped_spin_lock_num</a>());</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span>}</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span> </div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__queue.html#gaa13034dd0decdb0faf1b863383560be2">queue_free</a>(<a class="code hl_struct" href="structqueue__t.html">queue_t</a> *q);</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span> </div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"><a class="line" href="group__queue.html#ga2ebf4d2dec7ad019b03c2994defdf046">   83</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint <a class="code hl_function" href="group__queue.html#ga2ebf4d2dec7ad019b03c2994defdf046">queue_get_level_unsafe</a>(<a class="code hl_struct" href="structqueue__t.html">queue_t</a> *q) {</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span>    int32_t rc = (int32_t)q-&gt;wptr - (int32_t)q-&gt;rptr;</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno">   85</span>    <span class="keywordflow">if</span> (rc &lt; 0) {</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span>        rc += q-&gt;element_count + 1;</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno">   87</span>    }</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span>    <span class="keywordflow">return</span> (uint)rc;</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span>}</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span> </div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"><a class="line" href="group__queue.html#ga5cc5a58d2cac83f33aac5e8bb4e35147">   97</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint <a class="code hl_function" href="group__queue.html#ga5cc5a58d2cac83f33aac5e8bb4e35147">queue_get_level</a>(<a class="code hl_struct" href="structqueue__t.html">queue_t</a> *q) {</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span>    uint32_t save = <a class="code hl_function" href="group__hardware__sync.html#ga091e88a7608ed8dbf3e1e984bae54602">spin_lock_blocking</a>(q-&gt;core.spin_lock);</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span>    uint level = <a class="code hl_function" href="group__queue.html#ga2ebf4d2dec7ad019b03c2994defdf046">queue_get_level_unsafe</a>(q);</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span>    <a class="code hl_function" href="group__hardware__sync.html#ga281ce69786da23cab7ba6c42537d4e87">spin_unlock</a>(q-&gt;core.spin_lock, save);</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span>    <span class="keywordflow">return</span> level;</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno">  102</span>}</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno">  103</span> </div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno">  104</span><span class="preprocessor">#if PICO_QUEUE_MAX_LEVEL</span></div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno">  112</span><span class="keyword">static</span> <span class="keyword">inline</span> uint queue_get_max_level(<a class="code hl_struct" href="structqueue__t.html">queue_t</a> *q) {</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno">  113</span>    <span class="keywordflow">return</span> q-&gt;max_level;</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno">  114</span>}</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno">  115</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno">  116</span> </div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno">  117</span><span class="preprocessor">#if PICO_QUEUE_MAX_LEVEL</span></div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno">  123</span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> queue_reset_max_level(<a class="code hl_struct" href="structqueue__t.html">queue_t</a> *q) {</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno">  124</span>    uint32_t save = <a class="code hl_function" href="group__hardware__sync.html#ga091e88a7608ed8dbf3e1e984bae54602">spin_lock_blocking</a>(q-&gt;core.spin_lock);</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno">  125</span>    q-&gt;max_level = <a class="code hl_function" href="group__queue.html#ga2ebf4d2dec7ad019b03c2994defdf046">queue_get_level_unsafe</a>(q);</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno">  126</span>    <a class="code hl_function" href="group__hardware__sync.html#ga281ce69786da23cab7ba6c42537d4e87">spin_unlock</a>(q-&gt;core.spin_lock, save);</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno">  127</span>}</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno">  128</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno">  129</span> </div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"><a class="line" href="group__queue.html#ga8456f240608d3e58e5323bedadaeebe2">  138</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="group__queue.html#ga8456f240608d3e58e5323bedadaeebe2">queue_is_empty</a>(<a class="code hl_struct" href="structqueue__t.html">queue_t</a> *q) {</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno">  139</span>    <span class="keywordflow">return</span> <a class="code hl_function" href="group__queue.html#ga5cc5a58d2cac83f33aac5e8bb4e35147">queue_get_level</a>(q) == 0;</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno">  140</span>}</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno">  141</span> </div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"><a class="line" href="group__queue.html#gaed8287f549f6065fc89c5b56b9f9212e">  150</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="group__queue.html#gaed8287f549f6065fc89c5b56b9f9212e">queue_is_full</a>(<a class="code hl_struct" href="structqueue__t.html">queue_t</a> *q) {</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno">  151</span>    <span class="keywordflow">return</span> <a class="code hl_function" href="group__queue.html#ga5cc5a58d2cac83f33aac5e8bb4e35147">queue_get_level</a>(q) == q-&gt;element_count;</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno">  152</span>}</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno">  153</span> </div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno">  154</span><span class="comment">// nonblocking queue access functions:</span></div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno">  155</span> </div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno">  166</span><span class="keywordtype">bool</span> <a class="code hl_function" href="group__queue.html#ga42ddfda77fa6e9c6292deda62d993ae3">queue_try_add</a>(<a class="code hl_struct" href="structqueue__t.html">queue_t</a> *q, <span class="keyword">const</span> <span class="keywordtype">void</span> *data);</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno">  167</span> </div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno">  178</span><span class="keywordtype">bool</span> <a class="code hl_function" href="group__queue.html#ga31806423ac9c0b39ee7bb6473aa8d253">queue_try_remove</a>(<a class="code hl_struct" href="structqueue__t.html">queue_t</a> *q, <span class="keywordtype">void</span> *data);</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno">  179</span> </div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno">  190</span><span class="keywordtype">bool</span> <a class="code hl_function" href="group__queue.html#gab2d65c218a1826243d64f6305417dcc0">queue_try_peek</a>(<a class="code hl_struct" href="structqueue__t.html">queue_t</a> *q, <span class="keywordtype">void</span> *data);</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno">  191</span> </div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno">  192</span><span class="comment">// blocking queue access functions:</span></div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno">  193</span> </div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno">  202</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__queue.html#gad01f5e5ddf3403416097f31acc2dbeca">queue_add_blocking</a>(<a class="code hl_struct" href="structqueue__t.html">queue_t</a> *q, <span class="keyword">const</span> <span class="keywordtype">void</span> *data);</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno">  203</span> </div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno">  212</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__queue.html#ga97fb187c127e26935b37785692d1776b">queue_remove_blocking</a>(<a class="code hl_struct" href="structqueue__t.html">queue_t</a> *q, <span class="keywordtype">void</span> *data);</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno">  213</span> </div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno">  222</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__queue.html#ga104ec5baa82c9635163a511df7abf124">queue_peek_blocking</a>(<a class="code hl_struct" href="structqueue__t.html">queue_t</a> *q, <span class="keywordtype">void</span> *data);</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno">  223</span> </div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno">  224</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno">  225</span>}</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno">  226</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno">  227</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="agroup__hardware__sync_html_ga091e88a7608ed8dbf3e1e984bae54602"><div class="ttname"><a href="group__hardware__sync.html#ga091e88a7608ed8dbf3e1e984bae54602">spin_lock_blocking</a></div><div class="ttdeci">static __force_inline uint32_t spin_lock_blocking(spin_lock_t *lock)</div><div class="ttdoc">Acquire a spin lock safely.</div><div class="ttdef"><b>Definition:</b> spin_lock.h:301</div></div>
<div class="ttc" id="agroup__hardware__sync_html_ga281ce69786da23cab7ba6c42537d4e87"><div class="ttname"><a href="group__hardware__sync.html#ga281ce69786da23cab7ba6c42537d4e87">spin_unlock</a></div><div class="ttdeci">static __force_inline void spin_unlock(spin_lock_t *lock, uint32_t saved_irq)</div><div class="ttdoc">Release a spin lock safely.</div><div class="ttdef"><b>Definition:</b> spin_lock.h:332</div></div>
<div class="ttc" id="agroup__hardware__sync_html_ga8f4578aa492d4d37dfbdab5c99ab5b1c"><div class="ttname"><a href="group__hardware__sync.html#ga8f4578aa492d4d37dfbdab5c99ab5b1c">next_striped_spin_lock_num</a></div><div class="ttdeci">uint next_striped_spin_lock_num(void)</div><div class="ttdoc">Return a spin lock number from the striped range.</div><div class="ttdef"><b>Definition:</b> sync.c:18</div></div>
<div class="ttc" id="agroup__queue_html_ga0aa8e36b5c51158d836e16c5be2b9925"><div class="ttname"><a href="group__queue.html#ga0aa8e36b5c51158d836e16c5be2b9925">queue_init</a></div><div class="ttdeci">static void queue_init(queue_t *q, uint element_size, uint element_count)</div><div class="ttdoc">Initialise a queue, allocating a (possibly shared) spinlock.</div><div class="ttdef"><b>Definition:</b> queue.h:61</div></div>
<div class="ttc" id="agroup__queue_html_ga104ec5baa82c9635163a511df7abf124"><div class="ttname"><a href="group__queue.html#ga104ec5baa82c9635163a511df7abf124">queue_peek_blocking</a></div><div class="ttdeci">void queue_peek_blocking(queue_t *q, void *data)</div><div class="ttdoc">Blocking peek at next value to be removed from queue.</div><div class="ttdef"><b>Definition:</b> queue.c:121</div></div>
<div class="ttc" id="agroup__queue_html_ga2ebf4d2dec7ad019b03c2994defdf046"><div class="ttname"><a href="group__queue.html#ga2ebf4d2dec7ad019b03c2994defdf046">queue_get_level_unsafe</a></div><div class="ttdeci">static uint queue_get_level_unsafe(queue_t *q)</div><div class="ttdoc">Unsafe check of level of the specified queue.</div><div class="ttdef"><b>Definition:</b> queue.h:83</div></div>
<div class="ttc" id="agroup__queue_html_ga31806423ac9c0b39ee7bb6473aa8d253"><div class="ttname"><a href="group__queue.html#ga31806423ac9c0b39ee7bb6473aa8d253">queue_try_remove</a></div><div class="ttdeci">bool queue_try_remove(queue_t *q, void *data)</div><div class="ttdoc">Non-blocking removal of entry from the queue if non empty.</div><div class="ttdef"><b>Definition:</b> queue.c:105</div></div>
<div class="ttc" id="agroup__queue_html_ga42ddfda77fa6e9c6292deda62d993ae3"><div class="ttname"><a href="group__queue.html#ga42ddfda77fa6e9c6292deda62d993ae3">queue_try_add</a></div><div class="ttdeci">bool queue_try_add(queue_t *q, const void *data)</div><div class="ttdoc">Non-blocking add value queue if not full.</div><div class="ttdef"><b>Definition:</b> queue.c:101</div></div>
<div class="ttc" id="agroup__queue_html_ga5cc5a58d2cac83f33aac5e8bb4e35147"><div class="ttname"><a href="group__queue.html#ga5cc5a58d2cac83f33aac5e8bb4e35147">queue_get_level</a></div><div class="ttdeci">static uint queue_get_level(queue_t *q)</div><div class="ttdoc">Check of level of the specified queue.</div><div class="ttdef"><b>Definition:</b> queue.h:97</div></div>
<div class="ttc" id="agroup__queue_html_ga6b379b09df9ac326e3c07a2727b7ca96"><div class="ttname"><a href="group__queue.html#ga6b379b09df9ac326e3c07a2727b7ca96">queue_init_with_spinlock</a></div><div class="ttdeci">void queue_init_with_spinlock(queue_t *q, uint element_size, uint element_count, uint spinlock_num)</div><div class="ttdoc">Initialise a queue with a specific spinlock for concurrency protection.</div><div class="ttdef"><b>Definition:</b> queue.c:11</div></div>
<div class="ttc" id="agroup__queue_html_ga8456f240608d3e58e5323bedadaeebe2"><div class="ttname"><a href="group__queue.html#ga8456f240608d3e58e5323bedadaeebe2">queue_is_empty</a></div><div class="ttdeci">static bool queue_is_empty(queue_t *q)</div><div class="ttdoc">Check if queue is empty.</div><div class="ttdef"><b>Definition:</b> queue.h:138</div></div>
<div class="ttc" id="agroup__queue_html_ga97fb187c127e26935b37785692d1776b"><div class="ttname"><a href="group__queue.html#ga97fb187c127e26935b37785692d1776b">queue_remove_blocking</a></div><div class="ttdeci">void queue_remove_blocking(queue_t *q, void *data)</div><div class="ttdoc">Blocking remove entry from queue.</div><div class="ttdef"><b>Definition:</b> queue.c:117</div></div>
<div class="ttc" id="agroup__queue_html_gaa13034dd0decdb0faf1b863383560be2"><div class="ttname"><a href="group__queue.html#gaa13034dd0decdb0faf1b863383560be2">queue_free</a></div><div class="ttdeci">void queue_free(queue_t *q)</div><div class="ttdoc">Destroy the specified queue.</div><div class="ttdef"><b>Definition:</b> queue.c:20</div></div>
<div class="ttc" id="agroup__queue_html_gab2d65c218a1826243d64f6305417dcc0"><div class="ttname"><a href="group__queue.html#gab2d65c218a1826243d64f6305417dcc0">queue_try_peek</a></div><div class="ttdeci">bool queue_try_peek(queue_t *q, void *data)</div><div class="ttdoc">Non-blocking peek at the next item to be removed from the queue.</div><div class="ttdef"><b>Definition:</b> queue.c:109</div></div>
<div class="ttc" id="agroup__queue_html_gad01f5e5ddf3403416097f31acc2dbeca"><div class="ttname"><a href="group__queue.html#gad01f5e5ddf3403416097f31acc2dbeca">queue_add_blocking</a></div><div class="ttdeci">void queue_add_blocking(queue_t *q, const void *data)</div><div class="ttdoc">Blocking add of value to queue.</div><div class="ttdef"><b>Definition:</b> queue.c:113</div></div>
<div class="ttc" id="agroup__queue_html_gaed8287f549f6065fc89c5b56b9f9212e"><div class="ttname"><a href="group__queue.html#gaed8287f549f6065fc89c5b56b9f9212e">queue_is_full</a></div><div class="ttdeci">static bool queue_is_full(queue_t *q)</div><div class="ttdoc">Check if queue is full.</div><div class="ttdef"><b>Definition:</b> queue.h:150</div></div>
<div class="ttc" id="alock__core_8h_html"><div class="ttname"><a href="lock__core_8h.html">lock_core.h</a></div></div>
<div class="ttc" id="apico_8h_html"><div class="ttname"><a href="pico_8h.html">pico.h</a></div></div>
<div class="ttc" id="arp2__common_2hardware__sync_2include_2hardware_2sync_8h_html"><div class="ttname"><a href="rp2__common_2hardware__sync_2include_2hardware_2sync_8h.html">sync.h</a></div></div>
<div class="ttc" id="astructlock__core_html"><div class="ttname"><a href="structlock__core.html">lock_core</a></div><div class="ttdef"><b>Definition:</b> lock_core.h:53</div></div>
<div class="ttc" id="astructqueue__t_html"><div class="ttname"><a href="structqueue__t.html">queue_t</a></div><div class="ttdef"><b>Definition:</b> queue.h:32</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->

	<script src="main.js"></script>
</body>
</html>